From: Richard M. Stallman Date: Tue, 25 May 1993 01:00:21 +0000 (+0000) Subject: (XTread_socket, ConfigureNotify case): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96015 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3bd330d47a1f0c6d008e2d5ffe8612d1e9bce28c;p=emacs.git (XTread_socket, ConfigureNotify case): Convert from parent window, not Emacs window. (XTread_socket): Handle ReparentNotify events. (XTread_socket): For ConfigureNotify event, translate coordinates if send_event field is false provided the x-coord value is not large. --- diff --git a/src/xterm.c b/src/xterm.c index 8970185967c..046cf5100a6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2697,6 +2697,12 @@ XTread_socket (sd, bufp, numchars, waitp, expected) #endif break; + case ReparentNotify: + f = x_window_to_frame (event.xreparent.window); + if (f) + f->display.x->parent_desc = event.xreparent.parent; + break; + case Expose: f = x_window_to_frame (event.xexpose.window); if (f) @@ -3090,21 +3096,18 @@ XTread_socket (sd, bufp, numchars, waitp, expected) SET_FRAME_GARBAGED (f); } - if (! event.xconfigure.send_event - /* Sometimes we get root-relative coordinates - even tho send_event is 0. - This is not a perfectly reliable way of distinguishing, - but it does the right thing except in a case - where it doesn't hurt much to be wrong. */ - && event.xconfigure.x < 20) + if (! event.xconfigure.send_event) { Window win, child; int win_x, win_y; + /* Coords are relative to the parent. + Convert them to root-relative. */ XTranslateCoordinates (x_current_display, /* From-window, to-window. */ - event.xconfigure.window, ROOT_WINDOW, + f->display.x->parent_desc, + ROOT_WINDOW, /* From-position, to-position. */ event.xconfigure.x,